<?php /*a:2:{s:98:"G:\ssssss\eeeee\phpstudy_pro\WWW\zhengmaotong\public/themes/admin_simpleboot3/zmt\goods\index.html";i:1718865705;s:96:"G:\ssssss\eeeee\phpstudy_pro\WWW\zhengmaotong\public/themes/admin_simpleboot3/public\header.html";i:1690974980;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->


    <link href="/themes/admin_simpleboot3/public/assets/themes/<?php echo cmf_get_admin_style(); ?>/bootstrap.min.css" rel="stylesheet">
    <link href="/themes/admin_simpleboot3/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
    <link href="/static/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        form .input-order {
            margin-bottom: 0px;
            padding: 0 2px;
            width: 42px;
            font-size: 12px;
        }

        form .input-order:focus {
            outline: none;
        }

        .table-actions {
            margin-top: 5px;
            margin-bottom: 5px;
            padding: 0px;
        }

        .table-list {
            margin-bottom: 0px;
        }

        .form-required {
            color: red;
        }

        .td-actions .btn {
            margin-bottom: 2px;
            min-width: 96px;
            text-align: center;
        }

        .td-actions .btn:last-child {
            margin-bottom: 0;
        }
        a:hover, a:focus{
            text-decoration: none;
        }
    </style>
    <?php 
		$is_mobile=cmf_is_mobile();
        $_static_version='1.0.4';
        $cmf_version=cmf_version();
        if (strpos(cmf_version(), '6.') === 0) {
            $_app=app()->http->getName();
        }else{
            $_app=request()->module();
        }
     ?>
    <script type="text/javascript">
        //全局变量
        var GV = {
            ROOT: "/",
            WEB_ROOT: "/",
            JS_ROOT: "static/js/",
            APP: '<?php echo $_app; ?>'/*当前应用名*/,
            IS_MOBILE: <?php echo !empty($is_mobile) ? 'true'  :  'false'; ?>
        };
    </script>
    <script src="/themes/admin_simpleboot3/public/assets/js/jquery-1.12.4.min.js"></script>
    <script src="/themes/admin_simpleboot3/public/assets/js/jquery-migrate-1.4.1.min.js"></script>
<!--    <script src="/themes/admin_simpleboot3/public/assets/js/jquery-3.6.0.min.js"></script>-->
    <script src="/static/js/wind.js"></script>
    <script src="/themes/admin_simpleboot3/public/assets/js/bootstrap.min.js"></script>
    <script>
        Wind.css('artDialog');
        Wind.css('layer');
        $(function () {
            $("[data-toggle='tooltip']").tooltip({
                container: 'body',
                html: true,
            });
            $("li.dropdown").hover(function () {
                $(this).addClass("open");
            }, function () {
                $(this).removeClass("open");
            });
        });
    </script>
    <?php if(APP_DEBUG): ?>
        <style>
            #think_page_trace_open {
                z-index: 9999;
            }
        </style>
    <?php endif; ?>

</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="<?php echo url('goods/index'); ?>">商品主页</a></li>
        <li><a href="<?php echo url('goods/add'); ?>">商品添加</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="get" action="<?php echo url('goods/index'); ?>">
        查询:
        <input type="text" class="form-control" name="name" style="width: 240px;" value="<?php echo input('request.user_login/s',''); ?>" placeholder="请输入查询商品名称">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="<?php echo url('goods/index'); ?>">清空</a>
    </form>
    <form method="post" class="js-ajax-form margin-top-20" action="<?php echo url('goods/order'); ?>">
        <div class="table-actions">
            <button class="btn btn-sm btn-primary js-ajax-submit" type="submit">排序</button>
            <button class="btn btn-sm btn-success js-ajax-submit" type="submit"
                    data-action="<?php echo url('Link/toggle',array('display'=>1)); ?>" data-subcheck="true">显示
            </button>
            <button class="btn btn-sm btn-danger js-ajax-submit" type="submit"
                    data-action="<?php echo url('Link/toggle',array('hide'=>1)); ?>" data-subcheck="true">隐藏
            </button>
        </div>
        <?php $status=array("1"=>lang('DISPLAY'),"0"=>lang('HIDDEN')); ?>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x"
                                             data-checklist="js-check-x"></label></th>
                <th width="50">排序</th>
                <th width="50">ID</th>
                <th>商品名称</th>
                <th width="50">商品上传图片</th>
                <th width="50">商品款式</th>
                <th width="50">商品图表</th>
                <th width="50">商品内容宣传</th>
                <th width="120">商品出售方式</th>
                <th width="50">经营方式</th>
                <th width="120">商品初始价格</th>
                <th width="120">商品折扣价格</th>
                <th width="120">商品购买数量</th>
                <th width="50">创建时间</th>
                <th width="50">启用状态</th>
                <th width="50">操作</th>
            </tr>
            </thead>
            <tbody>
                <?php if(is_array($data) || $data instanceof \think\Collection || $data instanceof \think\Paginator): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?>
                    <tr>
                        <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                                   value=""></td>
                        <td><input name='list_orders[<?php echo $v['id']; ?>]' class="input input-order mr5" type='text' size='3'
                                   value='<?php echo $v['list_order']; ?>'></td>
                        <td width="50"><?php echo $v['id']; ?></td>
                        <td width="50"><?php echo $v['name']; ?></td>
                        <td ><img class="image-thumbnail js-image-previewer" onclick="imagePreviewDialog(this.src)" width="20px" src="/upload/<?php echo $v['image']; ?>"></td>
                        <td >
                            <?php echo (isset($v['cate']['name']) && ($v['cate']['name'] !== '')?$v['cate']['name']:'查询失败'); ?>
                        </td>
                        <td >
                        <?php if(is_array($v['chart']) || $v['chart'] instanceof \think\Collection || $v['chart'] instanceof \think\Paginator): if( count($v['chart'])==0 ) : echo "" ;else: foreach($v['chart'] as $key=>$vo): ?>
                            <img class="image-thumbnail " onclick="imagePreviewDialog(this.src)" width="80px" src="/upload/<?php echo $vo; ?>">
                        <?php endforeach; endif; else: echo "" ;endif; ?>
                        </td>
                        <td width="50"><?php echo $v['title']; ?></td>
                        <td>
                            <a href="<?php echo url('goods/changeStatus', ['id' => $v['id']]); ?>" class="btn btn-xs
                            <?php if($v['status'] == '0'): ?> btn-danger<?php endif; if($v['status'] == '1'): ?> btn-success<?php endif; if($v['status'] == '2'): ?> btn-warning<?php endif; ?>
                            js-ajax-dialog-btn"
                               data-msg="确定切换状态吗？">
                                <?php echo $statusMap[$v['status']]; ?>
                            </a>
                        </td>
                        <td width="50">
                            <a href="<?php echo url('goods/changeStatustwo', ['id' => $v['id']]); ?>" class="btn btn-xs
                            <?php if($v['switch'] == '0'): ?> btn-danger<?php endif; if($v['switch'] == '1'): ?> btn-success<?php endif; if($v['switch'] == '2'): ?> btn-warning<?php endif; ?>
                            js-ajax-dialog-btn"
                               data-msg="确定切换状态吗？">
                                <?php echo $Map[$v['switch']]; ?>
                            </a>
                        </td>
                        <td width="50"><?php echo $v['PrimaryPrice']; ?></td>
                        <td width="50"><?php echo $v['DiscountPrice']; ?></td>
                        <td width="50"><?php echo $v['number']; ?></td>
                        <td width="50"><?php echo $v['create_time']; ?></td>
                        <td width="50">
                            <?php if($v['switchtwo'] == '1'): ?>
                                <a href="<?php echo url('goods/totolgSwitchtwo',['id'=>$v['id']]); ?>" type="button" class="btn btn-success js-ajax-dialog-btn" data-msg="确定要进行相反操作吗？" >开启</a>
                                <?php else: ?>
                                <a href="<?php echo url('goods/totolgSwitchtwo',['id'=>$v['id']]); ?>" type="button" class="btn btn-danger js-ajax-dialog-btn" data-msg="确定要进行相反操作吗？" >关闭</a>
                            <?php endif; ?>
                        </td>
                        <td>
                            <div class="btn-group" role="group">
                                <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    商品配置<span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu">
                                    <li>
                                        <a href="javascript:void(0)" onclick="openIframeLayer('setGoodsAttr?goods_id=<?php echo $v['id']; ?>','配置商品属性',{area:['60%','80%']})">配置商品属性</a>
                                    </li>
                                    <li>
                                        <a href="javascript:void(0)" onclick="openIframeLayer('setGoodsAttrValue?goods_id=<?php echo $v['id']; ?>','配置商品属性值',{area:['60%','80%']})">配置商品属性</a>
                                    </li>
                                    <li>
                                        <a href="javascript:void(0)" onclick="openIframeLayer('setGoodsAttrdata?goods_id=<?php echo $v['id']; ?>','配置商品属性和属性值',{area:['60%','80%']})">配置商品属性</a>
                                    </li>
                                </ul>
                            </div>

                            <a class="btn btn-xs btn-primary" href="<?php echo url('goods/edit',['id'=>$v['id']]); ?>">编辑</a>
                            <a class="btn btn-xs btn-danger js-ajax-delete" href="<?php echo url('goods/delete',['id'=>$v['id']]); ?>">删除</a>
                        </td>
                    </tr>
                <?php endforeach; endif; else: echo "" ;endif; ?>
            </tbody>
        </table>
        <div class="pagination">

        </div>
    </form>
</div>
<script src="/static/js/admin.js?v=<?php echo $_static_version; ?>"></script>
<script src="/static/js/js-image-previewer.js"></script>

<script>
    $(document).ready(function() {
        $('.toggle-switch').click(function() {
            var button = $(this);
            var id = button.data('id');
            $.post("<?php echo url('News/toggleSwitch'); ?>", {id: id}, function(data) {
                if (data.status === 1) {
                    if (data.switch === 1) {
                        button.removeClass('btn-danger').addClass('btn-success').text('是');
                    } else {
                        button.removeClass('btn-success').addClass('btn-danger').text('否');
                    }
                } else {
                    alert(data.msg);
                }
            }, 'json');
        });
    });
</script>
</body>
</html>
